home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
c
/
uw_1.exe
/
UW_HELP2.HLP
< prev
next >
Wrap
Text File
|
1992-11-03
|
24KB
|
766 lines
`co(4,7);────────────────────────── /// Window I/O Routines ───────────────────────────`co();
┌──────────────────────────────────────────────────────────────────────────┐
│ `keyword(wn_plst,/// wn_plst); `keyword(wn_printf,/// wn_printf); `keyword(wn_st,/// wn_st); │
│ `keyword(wn_st_qty,/// wn_st_qty); `keyword(wn_qch,/// wn_qch); `keyword(wn_ch,/// wn_ch); │
│ `keyword(wn_och,/// wn_och); `keyword(wn_co,/// wn_co); `keyword(wn_hline,/// wn_hline); │
│ `keyword(wn_vline,/// wn_vline); `keyword(wn_cleol,/// wn_cleol); `keyword(wn_clbol,/// wn_clbol); │
│ `keyword(wn_claol,/// wn_claol); `keyword(wn_cleos,/// wn_cleos); `keyword(wn_clbos,/// wn_clbos); │
│ `keyword(wn_claos,/// wn_claos); `keyword(wn_cln,/// wn_cln); `keyword(wn_ins_del_chars,/// wn_ins_del_chars); │
│ `keyword(wn_ins_del_lines,/// wn_ins_del_lines); `keyword(wn_csr_dn,/// wn_csr_dn); `keyword(wn_csr_up,/// wn_csr_up); │
│ `keyword(wn_csr_left,/// wn_csr_left); `keyword(wn_csr_right,/// wn_csr_right); `keyword(wn_csr_pos,/// wn_csr_pos); │
│ `keyword(wn_scroll_reg,/// wn_scroll_reg); `keyword(wn_bksp,/// wn_bksp); │
│ `keyword(wn_st_fmt,/// wn_st_fmt); │
└──────────────────────────────────────────────────────────────────────────┘
These functions allow a great deal of flexibility for input/output to a
window. Included are string output routines, window "printf" capability,
multiple character output in both vertical and horizontal directions, line
drawing in a window with automatic blending of crossover points and border
intersection, clearing to the end of a line, beginning of line, end of
screen, and many others. New for V2.5 is an output routine that will
process control characters such as bell, backspace, tabs, carriage returns
and line feeds. It will even word wrap for you! See `keyword(wn_st_fmt,/// wn_st_fmt);
for more details.
`co(10,1);/// wn_plst`co(); `keyword(source,[UW_ST.C]~wn_plst);
Outputs a string to a window starting at a specific row and column.
Prototype:
void wn_plst( int col, int line, char *s, WINDOW *wnp );
Parameters:
`co(11,1); int col, row`co();
The location of the window to begin output. The column can also be set
to one of the three predefined values CENTERED, LEFT_JUST, and
RIGHT_JUST (defined in the file UW.H).
`co(11,1); uchar *s`co();
A pointer to the characters to place in the window.
`co(11,1); WINDOW *wnp`co();
A pointer to the window in which the string is to be placed.
Usage:
wn_plst( 10, 20, "This string starts at x = 10, y = 20.", wnp );
`co(10,1);/// wn_printf`co(); `keyword(source,[UW_PRTF.C]~wn_printf);
Outputs formatted text to a window at the current window cursor
position. The formatted output takes the same format string as the printf
family of functions.
Prototype:
int wn_printf( WINDOW *wnp, char *fmt, ... );
Parameters:
`co(11,1); WINDOW *wnp`co();
The window in which to place the formatted output.
`co(11,1); char *fmt`co();
The format string, followed by any variables, strings, etc...
Usage:
WINDOW *wnp;
int x = 10;
float f = 3.14;
...
wn_printf( wnp, "The value of x is %d, f is %4.2f", x, f );
`co(10,1);/// wn_st`co(); `keyword(source,[UW_ST.C]~wn_st);
Outputs the string at the current window cursor position.
Prototype:
void wn_st( char *s, WINDOW *wnp );
Parameters:
`co(11,1); uchar *s;`co();
The string to output to the window.
`co(11,1); WINDOW *wnp;`co();
The window in which the string will be placed.
Usage:
WINDOW *wnp;
...
wn_st( "This line will print at the window cursor position", wnp );
`co(10,1);/// wn_st_qty`co(); `keyword(source,[UW_ST.C]~wn_st_qty);
Outputs a specific number of characters from a string to the window at
the current window position. If the number to output is greater than the
string length, this function will output to the end of the string and
stop.
Prototype:
void wn_st_qty( char *s, int qty, WINDOW *wnp );
Parameters:
`co(11,1); uchar *s`co();
The string to output to the window.
`co(11,1); int qty`co();
The number of characters from the string to output.
`co(11,1); WINDOW *wnp`co();
A pointer to the window in which the output is to occur.
Usage:
WINDOW *wnp;
...
wn_st_qty( "Only 20 chars of this will be output", 20, wnp );
`co(10,1);/// wn_qch`co(); `keyword(source,[UW_CH.C]~wn_qch);
Outputs a character to a window a repeated number of times.
Prototype:
void wn_qch( int cnt, uchar c, WINDOW *wnp );
Parameters:
`co(11,1); int cnt`co();
The number of times to output the character.
`co(11,1); uchar c`co();
The character to output to the window.
`co(11,1); WINDOW *wnp`co();
A pointer to the window in which the output is to occur.
Usage:
WINDOW *wnp;
...
wn_qch( 20, '*', wnp );
`co(10,1);/// wn_ch`co(); `keyword(source,[UW_CH.C]~wn_ch);
Outputs one character at the current window cursor location.
Prototype:
void wn_ch( uchar c, WINDOW *wnp );
Parameters:
`co(11,1); uchar c`co();
The character to output to the window.
`co(11,1); WINDOW *wnp`co();
A pointer to the window in which the character is to be drawn.
Usage:
WINDOW *wnp;
...
wn_ch( 'A', wnp );
`co(10,1);/// wn_och`co(); `keyword(source,[UW_CH.C]~wn_och);
Returns the character located at the window cursor location.
Prototype:
uchar wn_och( WINDOW *wnp );
Parameters:
`co(11,1); WINDOW *wnp`co();
A pointer to the window in which to retrieve the character.
Usage:
WINDOW *wnp;
uchar val;
...
val = wn_och( wnp );
`co(10,1);/// wn_oatt`co(); `keyword(source,[UW_CH.C]~wn_oatt);
Returns the attribute located at the window cursor location.
Prototype:
uchar wn_oatt( WINDOW *wnp );
Parameters:
`co(11,1); WINDOW *wnp`co();
A pointer to the window in which to retrieve the attribute.
Usage:
WINDOW *wnp;
uchar val;
...
val = wn_oatt( wnp );
`co(10,1);/// wn_co`co(); `keyword(source,[UW_BDR.C]~wn_co);
Writes a specific number of characters starting at the current window
cursor location and moving downward. This is, in effect, a vertical
wn_qch routine.
Prototype:
void wn_co( int cnt, uchar c, WINDOW *wnp );
Parameters:
`co(11,1); int qty`co();
The number of times to output the character.
`co(11,1); uchar c`co();
The character to output to the window.
`co(11,1); WINDOW *wnp`co();
A pointer to the window in which to output the vertical string.
Usage:
WINDOW *wnp;
...
wn_co( 10, '*', wnp );
`co(10,1);/// wn_hline`co(); `keyword(source,[UW_BDR.C]~wn_hline);
Draws a horizontal line across the window, blending any intersections
with other lines and points where the line meets the window's left and
right border.
Prototype:
void wn_hline( int row, int style, WINDOW *wnp );
Parameters:
`co(11,1); int row`co();
The row number to place the horizontal line.
`co(11,1); int style`co();
The style of the line, SGL_BDR or DBL_BDR.
`co(11,1); WINDOW *wnp`co();
The window pointer for output.
Usage:
WINDOW *wnp;
...
wn_hline( 5, SGL_BDR, wnp );
`co(10,1);/// wn_vline`co(); `keyword(source,[UW_BDR.C]~wn_vline);
Draws a vertical line down the window, blending any intersections with
other lines and points where the line meets the window's bottom and top
border.
Prototype:
void wn_vline( int col, int style, WINDOW *wnp );
Parameters:
`co(11,1); int col`co();
The column number to place the vertical line.
`co(11,1); int style`co();
The style of the line, SGL_BDR or DBL_BDR.
`co(11,1); WINDOW *wnp`co();
The pointer to the window for output.
Usage: